A simple app for making it possible to join a certain wifi access point from HDC without requiring a rooted device. Also supports modifying proxy settings.
Since there is no way to start Ability by hdc command in HarmonyOS as adb in Android OS, it is currently only support for hard coding to join a wifi accesspoint. Modification of proxy setting are not supported neither. We will complete it as soon as HarmonyOS updating its sdk or supply corresponding mechanism.
install the app:
hdc app install build/outputs/hap/debug/phone/entry-debug-unsigned.hap
Use the Ability Manager to start the application with the appropriate parameters: (HarmonyOS does not support to start Ability with parameters by HDC, so the following commands can only be used after HarmonyOS supports them.)
To join a wifi network with no password such as:
hdc shell am start -n com.steinwurf.hdcjoinwifi/.MainAbility -e ssid SSID
To join a password protected wifi network such as:
hdc shell am start -n com.steinwurf.hdcjoinwifi/.MainAbility -e ssid SSID -e password_type WEP|WPA -e password PASSWORD
To join a wifi network and set a static proxy (with optional bypass list) such as:
hdc shell am start -n com.steinwurf.hdcjoinwifi/.MainAbility -e ssid SSID -e password_type WEP|WPA -e password PASSWORD -e proxy_host HOSTNAME -e proxy_port PORT [-e proxy_bypass COMMA,SEPARATED,LIST]
To join a wifi network and set a proxy auto-configuration URL:
hdc shell am start -n com.steinwurf.hdcjoinwifi/.MainAbility -e ssid SSID -e password_type WEP|WPA -e password PASSWORD -e proxy_pac_uri http://my.pac/url
To clear proxy settings, simply join the same network again and do not pass proxy arguments.
Device manager is not supported in harmony OS, so the following commands are not supported temporarily:
To get around this for testing purposes and modify any wifi configuration, you can grant this hap device owner privileges such as:
hdc shell dpm set-device-owner "com.steinwurf.hdcjoinwifi/.AdminReceiver"
This requires that your device has no provisioned accounts on it. If you wish to demote this app and remove its device owner privileges, run this:
hdc shell am start -n com.steinwurf.hdcjoinwifi/.MainAbility -e clear_device_admin true
Use hard coding to set the appropriate parameters to start the application:
in the MainAbility.java:
mSSID = "test";
mPasswordType = "WPA";
mPassword = "12345678";
You can change these wifi accesspoint parameters to make sure you are connected to a cetain hotspot.
hdc-join-wifi is available under the BSD license.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型